from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column

from config import DbBase


class Thumbnail(DbBase):
    __tablename__ = 'thumbnail'

    id: Mapped[str] = mapped_column(String(36), primary_key=True)
    original_path: Mapped[str] = mapped_column(String(255), unique=True, nullable=False)
    thumbnail_path: Mapped[str] = mapped_column(String(255), unique=True, nullable=False)

    def __repr__(self):
        return "<Thumbnail(id='%s', original_path='%s', thumbnail_path='%s')>" % (
            self.id, self.original_path, self.thumbnail_path)
